package calendar;

import java.util.Calendar;

public class CalendarDemo {

    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar);
        System.out.println(calendar.get(Calendar.YEAR)); //返回年份
        System.out.println(calendar.get(Calendar.MONTH)); //返回月份
        System.out.println(calendar.get(Calendar.DATE)); //返回日期
        System.out.println(calendar.get(Calendar.DAY_OF_WEEK));//返回星期几
        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));//返回日期
        System.out.println(calendar.get(Calendar.HOUR_OF_DAY));//返回小时
        System.out.println(calendar.get(Calendar.MINUTE));//返回分钟
        System.out.println(calendar.get(Calendar.SECOND));//返回秒
        System.out.println(calendar.getTimeZone());//返回时区

    }
}
